<template>
  <div class="header">
    <div class="image">
      <img src="../img/logo.png" alt="" />
      <span
        class="on-off"
        @click="TOGGLE_SIDEBAR"
        :class="sidebar ? 'el-icon-s-unfold' : 'el-icon-s-fold'"
      ></span>
    </div>

    <div class="name">
      <div>张总（超级管理员）</div>
      <div><img src="../img/gita.gif" alt="" />|</div>

      <div class="goto"><a href="#">退出登录</a></div>
    </div>
    <div class="na-1"><img src="../img/cn.png" alt="" /></div>
  </div>
</template>

<script>
import { mapGetters, mapMutations } from "vuex";
export default {
  name: "MyHeader",
  computed: {
    ...mapGetters(["sidebar"]),
  },
  methods: {
    ...mapMutations(["TOGGLE_SIDEBAR"]),
  },
};
</script>

<style lang="scss" scoped>
.header {
  position: relative;
  .na-1 {
    width: 50px;
    height: 50px;
    position: absolute;
    right: 0;
    top: 0;
    img {
      width: 50px;
      height: 50px;
    }
  }
  .image {
    width: 200px;
    height: 50px;
    .on-off {
      font-size: 20px;
      margin-left: 23px;
    }
    img {
      margin: 5px 0 5px 20px;
      width: 120px;
      height: 40px;
    }
  }
  .name {
    width: 285px;
    height: 50px;
    text-align: center;
    line-height: 50px;
    position: absolute;
    right: 40px;
    top: 0;
    display: flex;
    justify-content: space-around;
    img {
      width: 33px;
      height: 33px;
      margin-top: 5px;
      position: absolute;
      right: 90px;
      top: 0;
    }
    .goto {
      position: relative;
    }
    .goto::after {
      content: "";
      position: absolute;
      top: 18px;
      right: 69px;
      width: 1px;
      height: 15px;
      background: #e1e0e0;
    }
    a {
      color: #9fceff;
    }
  }
}
</style>